package com.companion.companion.service.impl;

import java.util.List;

import com.companion.companion.domain.Conversation;
import com.companion.companion.mapper.ConversationMapper;
import com.companion.companion.service.IConversationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 用户与护工之间的会话Service业务层处理
 * 
 * @author zly
 * @date 2025-05-06
 */
@Service
public class ConversationServiceImpl implements IConversationService
{
    @Autowired
    private ConversationMapper conversationMapper;

    /**
     * 查询用户与护工之间的会话
     * 
     * @param conversationId 用户与护工之间的会话主键
     * @return 用户与护工之间的会话
     */
    @Override
    public Conversation selectConversationByConversationId(Long conversationId)
    {
        return conversationMapper.selectConversationByConversationId(conversationId);
    }

    /**
     * 查询用户与护工之间的会话列表
     * 
     * @param conversation 用户与护工之间的会话
     * @return 用户与护工之间的会话
     */
    @Override
    public List<Conversation> selectConversationList(Conversation conversation)
    {
        return conversationMapper.selectConversationList(conversation);
    }

    /**
     * 新增用户与护工之间的会话
     * 
     * @param conversation 用户与护工之间的会话
     * @return 结果
     */
    @Override
    public int insertConversation(Conversation conversation)
    {
        return conversationMapper.insertConversation(conversation);
    }

    /**
     * 修改用户与护工之间的会话
     * 
     * @param conversation 用户与护工之间的会话
     * @return 结果
     */
    @Override
    public int updateConversation(Conversation conversation)
    {
        return conversationMapper.updateConversation(conversation);
    }

    /**
     * 批量删除用户与护工之间的会话
     * 
     * @param conversationIds 需要删除的用户与护工之间的会话主键
     * @return 结果
     */
    @Override
    public int deleteConversationByConversationIds(Long[] conversationIds)
    {
        return conversationMapper.deleteConversationByConversationIds(conversationIds);
    }

    /**
     * 删除用户与护工之间的会话信息
     * 
     * @param conversationId 用户与护工之间的会话主键
     * @return 结果
     */
    @Override
    public int deleteConversationByConversationId(Long conversationId)
    {
        return conversationMapper.deleteConversationByConversationId(conversationId);
    }
}
